#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 2e5 + 5;

int count(int n, int rad, int x) {
  int res = 0;
  int l0 = -n, r0 = n;
  int l = x - rad, r = x + rad;
  if (l <= l0) return 1;
  if (l >= n) return 1;
  if (l >= 0) {
    if (r > n)
      return 2 * (n - l);
    else
      return 2 * (r - l - 1);
  } else {
    if (r > n)
      return 2 * (n - abs(l)) + 1;
    else
      return 2 * (r - abs(l)) - 1;
  }
}
void solve() {
  int x, y, n, m;
  cin >> n >> x >> m >> y;
  if (x > y) swap(x, y);
  y -= x, x = 0;
  if (n > m) swap(n, m);
  ll sum = n + 1;
  if (y >= n + m)
    sum += m;
  else
    rep(i, 1, m) {
      // cout << i << ' ' << count(n, i, y) << endl;
      sum += count(n, i, y);
    }
  cout << sum;
  return;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int t = 1;
  while (t--) solve();
  return 0;
}